#pragma once
#include "../lua/ELuna.h"
#include "../libmaper/cMaper.h"

using namespace ELuna;
extern lua_State*	L;
class LuaMaper
{
public:
	LuaMaper(int c800, int c600);
	~LuaMaper();
	ELuna::LuaTable load(const char* path, int mapid);
	bool isObstacle(int x, int y);
	ELuna::LuaTable search(int x, int y, int tx, int ty);
	void step(int cx, int cy);
	void render();
	void renderAlpha();
private:
	int _mapid = 0;
	cMap* _map = nullptr;
	int _800 = 800, _600 = 600;
};